import { defineStore } from "pinia";
import { store } from "@/store";
const useRoutersStore = defineStore("app-routers", {
  state: () => ({
    routers: [],
    layoutRouters: [],
    authRouters: [],
  }),
  getters: {
    getRouters(): any[] {
      return this.routers;
    },
    getLayoutRouters(): any[] {
      return this.layoutRouters;
    },
  },
  actions: {
    setRouters(routers: any[]) {
      this.routers = routers;
    },
    setLayoutRouters(layoutRouters: any[]) {
      this.layoutRouters = layoutRouters;
    },
    async generateRoutes(routers: any[]) {
      // console.log(`routers`, routers);
    },
  },
});

export function useRouters() {
  return useRoutersStore(store);
}
